package com.lxmes.business.mapper;

import java.math.BigDecimal;
import java.util.List;
import com.lxmes.business.domain.CcStockInfo;
import com.lxmes.common.annotation.DataScope;
import org.apache.ibatis.annotations.Param;

/**
 * 库存明细Mapper接口
 *
 * @author 张志煜
 * @date 2022-11-29
 */
public interface CcStockInfoMapper
{
    /**
     * 查询库存明细
     *
     * @param id 库存明细主键
     * @return 库存明细
     */
    public CcStockInfo selectCcStockInfoById(Long id);
    public CcStockInfo selectCcStockinfoInfoByObj(CcStockInfo ccStockInfo);
    public CcStockInfo selectCcStockinfoInfoByItemIdAndLotAndKuwei(@Param("itemId") String itemId, @Param("lot")String lot,@Param("kuweiCode")String kuweiCode);
    //计算物料的库存数量
    public BigDecimal countStockInfoKyNum( CcStockInfo ccStockInfo);
    //查询入库默认的库位
    public CcStockInfo selectCcStockInfoDefault(CcStockInfo ccStockInfo);
    /**
     * 查询库存明细列表
     *
     * @param ccStockInfo 库存明细
     * @return 库存明细集合
     */
    @DataScope(deptAlias = "st", userAlias = "st")
    public List<CcStockInfo> selectCcStockInfoList(CcStockInfo ccStockInfo);
    @DataScope(deptAlias = "st", userAlias = "st")
    public List<CcStockInfo> selectCcStockInfoList1(CcStockInfo ccStockInfo);
    @DataScope(deptAlias = "st", userAlias = "st")
    public List<CcStockInfo> selectCcStockInfoList2(CcStockInfo ccStockInfo);
    @DataScope(deptAlias = "st", userAlias = "st")
    public List<CcStockInfo> selectCcStockInfoList3(CcStockInfo ccStockInfo);
    //扫码出库查库存
    @DataScope(deptAlias = "st", userAlias = "st")
    public CcStockInfo selectCcStockInfoBySmCk(CcStockInfo ccStockInfo);
    @DataScope(deptAlias = "st", userAlias = "st")
    public List<CcStockInfo> selectCcStockInfoMainList(CcStockInfo ccStockInfo);
    @DataScope(deptAlias = "st", userAlias = "st")
    public List<CcStockInfo> selectCcStockInfoListExport(CcStockInfo ccStockInfo);
    public List<CcStockInfo> selectCcStockInfoListByItemId(String itemId);
//    public List<CcStockInfo> selectCcStockInfoListByItemIdAnd(String itemId);

    /*根据多个ID查询库存*/
    public List<CcStockInfo> selectCcStockinfoInfoByIds(Long[] ids);

    /**
     * 新增库存明细
     *
     * @param ccStockInfo 库存明细
     * @return 结果
     */
    public int insertCcStockInfo(CcStockInfo ccStockInfo);

    /**
     * 修改库存明细
     *
     * @param ccStockInfo 库存明细
     * @return 结果
     */
    public int updateCcStockInfo(CcStockInfo ccStockInfo);

    /**
     * 删除库存明细
     *
     * @param id 库存明细主键
     * @return 结果
     */
    public int deleteCcStockInfoById(Long id);

    /**
     * 批量删除库存明细
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCcStockInfoByIds(Long[] ids);
}
